home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / tex / mf / inputs / misc / lasychr.mf < prev    next >
Text File  |  1992-09-12  |  15KB  |  380 lines

  1. %
  2. % These characters are taken from LASY.MF by L.Lamport
  3. % with minor changes and extensions (so 100% compatible)
  4. %
  5.  
  6. cmchar "Leftward arrowhead";
  7. compute_spread(.45x_height#,.55x_height#);
  8. beginchar(hex"28",6u#,v_center(spread#+rule_thickness#));
  9. adjust_fit(0,0); pickup crisp.nib;
  10. pos3(bar,0); pos4(bar,0);
  11. y0=math_axis; lft x0=hround u;
  12. y3-y0=y0-y4=.24asc_height+eps; x3=x4=x0+3u+eps;
  13. pos5(bar,angle(z4-z0)); z5l=z0; pos6(bar,angle(z3-z0)); z6l=z0;
  14. z9=.381966[.5[z3,z4],z0];
  15. numeric t[]; path p[];
  16. (t1,t2)=(z4r{z9-z4}..z6r) intersectiontimes (z3r{z9-z3}..z5r);
  17. z10=(z4r{z9-z4}..z6r) intersectionpoint (z3r{z9-z3}..z5r);
  18. filldraw z0..{z4-z9}z4l--subpath (0,t1) of (z4r{z9-z4}..z6r)
  19.  --z10--subpath (t2,0) of (z3r{z9-z3}..z5r)--z3l{z9-z3}..z0 & cycle;
  20.   % arrowhead
  21. penlabels(0,3,4,5,6,9,10); endchar;
  22.  
  23. % This character is an alteration of the leftward arrow
  24. % The tip of the arrowhead rests one unit from left edge, same as left arrow
  25. % Changes:
  26. %   1) deletion of the stem ... points z1,z2 etc
  27. %      The rest of the numbers stay the same, for any referencing
  28. %   2) new intersectinpoint z10 is introduced and path slightly altered
  29. %   3) name, code number and width changed, otherwise essentially the same
  30.  
  31.  
  32.  
  33. cmchar "Rightward arrowhead";
  34. compute_spread(.45x_height#,.55x_height#);
  35. beginchar(hex"29",6u#,v_center(spread#+rule_thickness#));
  36. adjust_fit(0,0); pickup crisp.nib;
  37. pos3(bar,0); pos4(bar,0);
  38. y0=math_axis; rt x0=hround(w-u);
  39. y3-y0=y0-y4=.24asc_height+eps; x3=x4=x0-3u-eps;
  40. pos5(bar,angle(z4-z0)); z5l=z0; pos6(bar,angle(z3-z0)); z6l=z0;
  41. z9=.381966[.5[z3,z4],z0];
  42. numeric t[]; path p[];
  43. (t1,t2)=(z4l{z9-z4}..z6r) intersectiontimes (z3l{z9-z3}..z5r);
  44. z10=(z4l{z9-z4}..z6r) intersectionpoint (z3l{z9-z3}..z5r);
  45. filldraw z0..{z4-z9}z4r--subpath (0,t1) of (z4l{z9-z4}..z6r)
  46.  --z10--subpath (t2,0) of (z3l{z9-z3}..z5r)--z3r{z9-z3}..z0 & cycle;
  47.   % arrowhead
  48. penlabels(0,3,4,5,6,9,10); endchar;
  49.  
  50. % This character is an alteration of the rightward arrow
  51. % The tip of the arrowhead rests one unit from right edge, same as right arrow
  52. % Changes:
  53. %   1) deletion of the stem ... points z1,z2 etc
  54. %      The rest of the numbers stay the same, for any referencing
  55. %   2) new intersectinpoint z10 is introduced and path slightly altered
  56. %   3) name, code number and width changed, otherwise essentially the same
  57.  
  58.  
  59.  
  60. cmchar "Upward arrowhead";
  61. beginchar(hex"2A",9u#,asc_height#,asc_depth#);
  62. italcorr .76asc_height#*slant+.5crisp#-u#;
  63. adjust_fit(0,0); pickup crisp.nib;
  64. pos3(bar,90); pos4(bar,90);
  65. top z0=(.5w,0); x0-x3=x4-x0=3u+eps;
  66. y3=y4=y0-.24asc_height-eps;
  67. pos5(bar,angle(z4-z0)); z5l=z0;
  68. pos6(bar,angle(z3-z0)); z6l=z0;
  69. z9=.381966[.5[z3,z4],z0];
  70. numeric t[]; path p[];
  71. (t1,t2)=(z4l{z9-z4}..z6r) intersectiontimes (z3l{z9-z3}..z5r);
  72. z10=(z4l{z9-z4}..z6r) intersectionpoint (z3l{z9-z3}..z5r);
  73. filldraw z0..{z4-z9}z4r--subpath (0,t1) of (z4l{z9-z4}..z6r)
  74.  --z10--subpath (t2,0) of (z3l{z9-z3}..z5r)--z3r{z9-z3}..z0 & cycle;
  75.   % arrowhead
  76. penlabels(0,3,4,5,6,9,10); endchar;
  77.  
  78. % This character is an alteration of the upward arrow
  79. % The tip of the arrowhead rests on the baseline for reference
  80. % Changes:
  81. %   1) deletion of the stem ... points z1,z2 etc
  82. %      The rest of the numbers stay the same, for any referencing
  83. %   2) point z0 is moved down from the ascender line; the tip touches
  84. %      the baseline
  85. %   3) new intersectinpoint z10 is introduced and path slightly altered
  86. %   4) name and code number changed, otherwise essentially the same
  87.  
  88.  
  89.  
  90. cmchar "Downward arrowhead";
  91. beginchar(hex"2B",9u#,asc_height#,asc_depth#);
  92. adjust_fit(0,0); pickup crisp.nib;
  93. pos3(bar,90); pos4(bar,90);
  94. bot z0=(.5w,0); x0-x3=x4-x0=3u+eps;
  95. y3=y4=y0+.24asc_height+eps;
  96. pos5(bar,angle(z4-z0)); z5l=z0;
  97. pos6(bar,angle(z3-z0)); z6l=z0;
  98. z9=.381966[.5[z3,z4],z0];  % z9 iintroduces curve to arrowhead
  99. numeric t[]; path p[];    %  rather direction{z9-z4} does this
  100. (t1,t2)=(z4r{z9-z4}..z6r) intersectiontimes (z3r{z9-z3}..z5r);
  101. z10=(z4r{z9-z4}..z6r) intersectionpoint (z3r{z9-z3}..z5r);
  102. filldraw z0..{z4-z9}z4l--subpath (0,t1) of (z4r{z9-z4}..z6r)
  103.  --z10--subpath (t2,0) of (z3r{z9-z3}..z5r)--z3l{z9-z3}..z0 & cycle;
  104.   % arrowhead
  105. penlabels(0,3,4,5,6,9,10); endchar;
  106.  
  107. % This character is an alteration of the downward arrow
  108. % The tip of the arrowhead rests on the baseline for reference
  109. % Changes:
  110. %   1) deletion of the stem ... points z1,z2 etc
  111. %      The rest of the numbers stay the same, for any referencing
  112. %   2) point z0 is moved up from the descender line to rest on the baseline
  113. %   3) new intersectinpoint z10 is introduced and path slightly altered
  114. %   4) name and code number changed, otherwise essentially the same
  115.  
  116.  
  117. cmchar "Upside-down Uppercase Greek Omega";
  118. beginchar(hex"30",13u#,cap_height#,0);
  119. italcorr cap_height#*slant-.35u#;  %italcorr .75cap_height#*slant-.5u#;
  120. adjust_fit(0,0);
  121. pickup tiny.nib; pos1(vair,-90); pos2(cap_curve,0);
  122. pos3(vair,0); pos4(cap_curve,180); pos5(vair,180);
  123. x1=.5w; bot y1r=0-o; lft x4r=hround u; y2=y4=1/3h; x2=w-x4;
  124. rt x5l=hround(1/3(w+.5u)+.5hair); top y3=top y5=h; x3=w-x5;
  125. filldraw stroke z3e{down}...{down}z2e
  126.  & pulled_super_arc.e(2,1)(.5superpull)
  127.  & pulled_super_arc.e(1,4)(.5superpull)
  128.  & z4e{up}...{up}z5e;        % bowl
  129. numeric arm_thickness; path p; p=z3{down}...{down}z2;
  130. arm_thickness=Vround(if hefty:slab+2stem_corr else:.75[slab,cap_vstem] fi);
  131. pickup crisp.nib; pos6(arm_thickness,90); pos7(fudged.hair,0);
  132. top y6r=h; x6=x3; rt x7r=hround (w-.8u); y7=good.y(y6l-.5beak)+eps;
  133. (x,y)=p intersectionpoint((0,y6l)--(w+h,y6l)); x6l:=x;
  134. arm(6,7,a,.5beak_darkness,1.2beak_jut);    % right arm and beak
  135. pos8(arm_thickness,90); pos9(fudged.hair,180);
  136. y8=y6; y9=y7; x8+x6=x9+x7=w; x8l:=w-x6l;
  137. arm(8,9,b,.5beak_darkness,-1.2beak_jut);  % left arm and beak
  138. math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9); endchar;
  139.  
  140. % This character is taken from the Upper Case Omega of cmr
  141. % Directions and reference points are reversed and flipped
  142. %   pos angles are flipped by 180 degrees
  143. %   vertical values are reversed, up/down directions in the
  144. %     filldraw stroke are reversed
  145. % left strokes same, but changes reference points
  146. % italic correction based on furthest pont of character , so made it
  147. %   full cap_height minus amount for the beak, taken from the cap XI
  148. % I suppose a transformation of paths would have worked also, but this
  149. %   way, limits are maintained better, i think
  150. % w+h instead of just w in intersection to make sure paths do intersect
  151.  
  152. cmchar "Square subset sign";
  153. compute_spread(5/4x_height#,3/2x_height#); % the spread of `$=$'
  154. beginchar(hex"3C",14u#,v_center(spread#+rule_thickness#));
  155. adjust_fit(0,0); pickup rule.nib;
  156. lft x2=hround(1.5u+oo); x1=x4=hround(w-1.5u)+eps; x3=x2;
  157. y1-y4=spread; y2=y1; y3=y4; y1=math_axis+.5spread;
  158. draw z1--z2--z3--z4;  % bars and stem
  159. labels(1,2,3,4); endchar;
  160.  
  161. % This character is an alteration of the square subset or equal to sign
  162. % Changes:
  163. %   1) changed position of y1 to be .5 of the spread above the math_axis
  164. %   2) got rid of lower bar (points z8/z9,etc) and the extra spread#' amount
  165. %      which was used in calculations for the lower bar
  166. %   3) name and code number and height changed, otherwise essentially the same
  167.  
  168. cmchar "Square superset sign";
  169. compute_spread(5/4x_height#,3/2x_height#); % the spread of `$=$'
  170. beginchar(hex"3D",14u#,v_center(spread#+rule_thickness#));
  171. adjust_fit(0,0); pickup rule.nib;
  172. x1=x4=hround 1.5u-eps; rt x2=hround(w-1.5u-oo); x3=x2;
  173. y1-y4=spread; y2=y1; y3=y4; y1=math_axis+.5spread;
  174. draw z1--z2--z3--z4;  % bars and stem
  175. labels(1,2,3,4); endchar;
  176.  
  177. % This character is an alteration of the square superset or equal to sign
  178. % Changes:
  179. %   1) changed position of y1 to be .5 of the spread above the math_axis
  180. %   2) got rid of lower bar (points z8/z9,etc) and the extra spread#' amount
  181. %      which was used in calculations for the lower bar
  182. %   3) name and code number and height changed, otherwise essentially the same
  183.  
  184. cmchar "Diamond";
  185. %beginchar(oct"063",2(.85asc_height#-math_axis#)+2u#,v_center(7u#));
  186. beginchar(hex"33",2(.85asc_height#-math_axis#)+2u#,
  187.           v_center(2(.85asc_height#-math_axis#)));
  188. italcorr math_axis#*slant;
  189. adjust_fit(0,0); pickup rule.nib;
  190. numeric a; a=.85asc_height-math_axis;
  191. x4=x8=good.x .5w; w:=r:=2x4; rt x2=w-lft x6=good.x(x4+a);
  192. y2=y6=.5[y4,y8]=.5cap_height; top y8=good.y(y2+a);
  193. draw z2--z4--z6--z8--cycle;
  194. labels(2,4,6,8); endchar;
  195.  
  196. % This character is an alteration of the diamond operator
  197. % The four tips are equidistant from the center point (.5w,math_axis),
  198. %    this distance being half of the cap height
  199. %    and related to that in the square character
  200. %    slightly less though, since it looks too big if the actually have same
  201. %    length
  202. % Changes:
  203. %   1) To the amount a, which gives the distance of the tips from the center
  204. %   2) The width is related to the asc_height, so it changes with it
  205. %   3) name and code number and width changed, otherwise essentially the same
  206. %      The numbers stay the same, for any referencing
  207.  
  208. cmchar "Bowtie operator";
  209. beginchar(hex"31",13u#,v_center(7u#));
  210. italcorr math_axis#*slant;
  211. adjust_fit(0,0); pickup rule.nib;
  212. numeric a; a=round(1.1*math_axis);
  213. x1=x4=good.x 1.5u; x2=x3=w-x1;
  214. y1=y2=good.y(.5(cap_height-2a)); y3=y4=y1+2a;
  215. draw z1--z3--z2--z4--cycle;
  216. labels(1,2,3,4); endchar;
  217.  
  218. % Arbitrary width given
  219. % Length of the bars at the edges are 2.2*math_axis length
  220. %   and it's vertically aligned on the high, i.e., .5 cap height as opposed
  221. %   to being aligned on the math axis
  222.  
  223.  
  224.  
  225.  
  226. cmchar "Leads to character extension";
  227. compute_spread(.45x_height#,.55x_height#);
  228. beginchar(hex"3A",12u#,v_center(spread#+rule_thickness#));
  229. adjust_fit(0,0); pickup rule.nib;
  230. numeric a; a=round(.45math_axis);
  231. y11=y13=y15=math_axis; y12-a=y14+a=good.y math_axis;
  232. x11=0; x15=w; x13=.5[x11,x15]; x12=.5[x11,x13]; x14=.5[x13,x15];
  233. path p; p=z12{right}...z13...z14{right};
  234. draw z11{dir(-angle direction 1 of p)}...z12{right}...z13...
  235.      z14{right}...z15{dir(-angle direction 1 of p)};
  236. penlabels(11,12,13,14,15); endchar;
  237.  
  238. % This character is an extension to fit with the Leads to character with
  239. %   arrowhead
  240. % This character goes from edge to edge and a series of these can be linked
  241. %   as desired.
  242. % It has 2/3 the width of that character, and if this relation is kept, the
  243. %   the curves should all match
  244.  
  245.  
  246.  
  247. cmchar "Leads to character with arrowhead";
  248. compute_spread(.45x_height#,.55x_height#);
  249. beginchar(hex"3B",18u#,v_center(spread#+rule_thickness#));
  250. adjust_fit(0,0); pickup crisp.nib;
  251. pos3(bar,0); pos4(bar,0);
  252. y0=math_axis; rt x0=hround(w-u);
  253. y3-y0=y0-y4=.24asc_height+eps; x3=x4=x0-3u-eps;
  254. pos5(bar,angle(z4-z0)); z5l=z0; pos6(bar,angle(z3-z0)); z6l=z0;
  255. z9=.381966[.5[z3,z4],z0];
  256. numeric t[]; path p[];
  257. (t1,t2)=(z4l{z9-z4}..z6r) intersectiontimes (z3l{z9-z3}..z5r);
  258. z10=(z4l{z9-z4}..z6r) intersectionpoint (z3l{z9-z3}..z5r);
  259. filldraw z0..{z4-z9}z4r--subpath (0,t1) of (z4l{z9-z4}..z6r)
  260.  --z10--subpath (t2,0) of (z3l{z9-z3}..z5r)--z3r{z9-z3}..z0 & cycle;
  261.   % arrowhead
  262. pickup rule.nib;
  263. numeric a; a=round(.45math_axis);
  264. y11=y13=y15=y16=y0; y12-a=y14+a=good.y math_axis;
  265. %x11=0; x15=2/3w; z17=lft z10;
  266. %x13=.5[x11,x15]; x12=.5[x11,x13]; x14=.5[x13,x15]; x16=.3[x15,x0];
  267. x11=0; x15=0.7w; z17=lft z10;
  268. x13=.5[x11,x15]; x12=.5[x11,x13]; x14=.5[x13,x15]; x16=.5[x15,x0];
  269. path p; p=z12{right}...z13...z14{right};
  270. draw z11{dir(-angle direction 1 of p)}...
  271.        z12{right}...z13...z14{right}...z16{right}...z17;
  272. penlabels(0,3,4,5,6,9,10,11,12,13,14,15,16); endchar;
  273.  
  274. % This character uses the rightward arrow arrowhead
  275. % The width is the same as that of the regular arrow
  276. % An extension character can be added for longer squiggles
  277.  
  278.  
  279. cmchar "LASY \lhd triangle";
  280. compute_spread(5/4x_height#,3/2x_height#);
  281. beginchar(1,14u#,v_center(spread#+rule_thickness#));
  282. italcorr h#*slant-u#;
  283. adjust_fit(0,0); pickup rule.nib;
  284. lft x2=hround 1.5u-eps; x1=x3=w-x2;
  285. y1-y3=spread; y2=.5[y1,y3]=math_axis;
  286. draw z1--z2--z3--cycle;  % triangle
  287. labels(1,2,3); endchar;
  288.  
  289. % taken directly from CMR "less than" character
  290. % the path was closed to make a triangle
  291.  
  292. cmchar "black LASY \lhd triangle";
  293. compute_spread(5/4x_height#,3/2x_height#);
  294. beginchar(16,14u#,v_center(spread#+rule_thickness#));
  295. italcorr h#*slant-u#;
  296. adjust_fit(0,0); pickup crisp.nib;
  297. lft x2=hround 1.5u-eps; x1=x3=w-x2;
  298. y1-y3=spread; y2=.5[y1,y3]=math_axis;
  299. filldraw z1--z2--z3--cycle;  % triangle
  300. labels(1,2,3); endchar;
  301.  
  302.  
  303. cmchar "LASY \unlhd triangle";
  304. compute_spread(.45x_height#,.55x_height#);
  305. spread#':=spread#; spread':=spread; % the spread of `$=$'
  306. compute_spread(5/4x_height#,3/2x_height#);
  307. beginchar(2,14u#,v_center(spread#'+spread#+rule_thickness#));
  308. italcorr h#*slant-u#;
  309. adjust_fit(0,0); pickup rule.nib;
  310. lft x2=hround 1.5u-eps; x1=x3=w-x2;
  311. y1-y3=spread; y2=.5[y1,y3]; top y1=h;
  312. draw z1--z2--z3--cycle;  % triangle
  313. x8=x1; x9=x2; y8=y9; y3-y9=spread'; draw z8--z9;  % bar
  314. labels(1,2,3,8,9); endchar;
  315.  
  316. % taken directly from CMR "less than or equal to sign"
  317. % the "less than" path was closed to make a triangle
  318.  
  319.  
  320.  
  321. cmchar "LASY \rhd triangle";
  322. compute_spread(5/4x_height#,3/2x_height#);
  323. beginchar(3,14u#,v_center(spread#+rule_thickness#));
  324. italcorr math_axis#*slant-u#;
  325. adjust_fit(0,0); pickup rule.nib;
  326. rt x2=hround(w-1.5u)+eps; x1=x3=w-x2;
  327. y1-y3=spread; y2=.5[y1,y3]=math_axis;
  328. draw z1--z2--z3--cycle;  % triangle
  329. labels(1,2,3); endchar;
  330.  
  331. % taken directly from CMR "greater than" character
  332. % the path was closed to make a triangle
  333.  
  334. cmchar "black LASY \rhd triangle";
  335. compute_spread(5/4x_height#,3/2x_height#);
  336. beginchar(17,14u#,v_center(spread#+rule_thickness#));
  337. italcorr math_axis#*slant-u#;
  338. adjust_fit(0,0); pickup crisp.nib;
  339. rt x2=hround(w-1.5u)+eps; x1=x3=w-x2;
  340. y1-y3=spread; y2=.5[y1,y3]=math_axis;
  341. filldraw z1--z2--z3--cycle;  % triangle
  342. labels(1,2,3); endchar;
  343.  
  344. cmchar "LASY \unrhd triangle";
  345. compute_spread(.45x_height#,.55x_height#);
  346. spread#':=spread#; spread':=spread; % the spread of `$=$'
  347. compute_spread(5/4x_height#,3/2x_height#);
  348. beginchar(4,14u#,v_center(spread#'+spread#+rule_thickness#));
  349. italcorr h#*slant-u#;
  350. adjust_fit(0,0); pickup rule.nib;
  351. lft x1=hround 1.5u-eps; x2=w-x1; x3=x1;
  352. y1-y3=spread; y2=.5[y1,y3]; top y1=h;
  353. draw z1--z2--z3--cycle;  % triangle
  354. x8=x1; x9=x2; y8=y9; y3-y9=spread'; draw z8--z9;  % bar
  355. labels(1,2,3,8,9); endchar;
  356.  
  357. % taken directly from CMR "greater than or equal to sign"
  358. % the "greater than" path was closed to make a triangle
  359.  
  360. cmchar "upwards pointing black triangle";
  361. compute_spread(5/4x_height#,3/2x_height#);
  362. beginchar(hex"4B",spread#+rule_thickness#,v_center(11u#));
  363. italcorr 0;
  364. adjust_fit(0,0); pickup crisp.nib;
  365. top y2= h+eps; y1=y3; y2-y1 = vround (h+d);
  366. x1-x3=spread; x2=.5[x1,x3]=good.x .5w;
  367. filldraw z1--z2--z3--cycle;  % triangle
  368. labels(1,2,3); endchar;
  369.  
  370. cmchar "downwards pointing black triangle";
  371. compute_spread(5/4x_height#,3/2x_height#);
  372. beginchar(hex"4C",spread#+rule_thickness#,v_center(11u#));
  373. italcorr 0;
  374. adjust_fit(0,0); pickup crisp.nib;
  375. bot y2= (-d)-eps; y1=y3; y1-y2 = vround (h+d);
  376. x1-x3=spread; x2=.5[x1,x3]=good.x .5w;
  377. filldraw z1--z2--z3--cycle;  % triangle
  378. labels(1,2,3); endchar;
  379.  
  380.